﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ViewModels="clr-namespace:DemoApp.ViewModels" x:Class="DemoApp.MainWindow"
        Title="Color Picker" Height="500" Width="535">
    <Window.DataContext>
        <ViewModels:MainPageViewModel/>
    </Window.DataContext>
    <Grid>
        <ScrollViewer Padding="10">
            <ItemsControl ItemsSource="{Binding Items}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid Height="150" Width="150" Margin="5" Background="{Binding Brush}">
                            <Grid VerticalAlignment="Top">
                                <Grid.Background>
                                    <SolidColorBrush Color="White" Opacity=".5" />
                                </Grid.Background>
                                <TextBlock Text="{Binding ColorItem.Name}" Margin="10" FontWeight="Light" />
                            </Grid>
                            <Button Command="{Binding SelectCommand}" Content="Set Color" VerticalAlignment="Bottom" Padding="0,10" Margin="10" />
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</Window>
